<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8"/>
        <title>PHP+MySQLI的学生信息管理</title>
        <link type="text/css" rel="stylesheet" href="./bootstrap.min.css"/>
        <script type="text/javascript">
            function doDel(id){
                if(confirm("确定要删除吗？")){
                    //跳转
                    window.location.href="__URL__/del/id/"+id;
                }
            }
        </script>
    </head>
    <body>
        <center>
           @include("stu.menu")
            <h3>浏览学生信息</h3>
            <table width="700" border="1">
                <tr>
                    <th>学号</th>
                    <th>姓名</th>
                    <th>性别</th>
                    <th>年龄</th>
                    <th>班级</th>
                    <th>操作</th>
                </tr>
                @foreach($list as $stu)
                    <tr>
                        <td>{{$stu->id}}</td>
                        <td>{{$stu->name}}</td>
                        <td>{{$stu->sex}}</td>
                        <td>{{$stu->age}}</td>
                        <td>{{$stu->classid}}</td>
						<td><form action="{{url('stu/destroy')}}" method="POST">
                            <input type="hidden" name="_method" value="DELETE">
                            <input type="hidden" name="id" value="{{$stu->id}}" >
                            <input type="hidden" name="_token" value="{{ csrf_token() }}">
                            <input type="submit" value="删除">
                            
                        </form>
						<a href="stu/{{$stu->id}}/edit">编辑</a>
						</td>

                    </tr>
                @endforeach
            </table>
            
        </center>
    </body>
</html>